<?php
namespace App\Model;

use Illuminate\Database\Eloquent\Model;
use Spatie\MediaLibrary\HasMedia\HasMedia;
use Spatie\MediaLibrary\HasMedia\HasMediaTrait;

class OrderGoods extends Model implements HasMedia
{

    use HasMediaTrait;

    protected $table = 'order_goods';

    /**
     * 获取商品
     */
    public function goods()
    {
        return $this->hasOne('App\Model\Goods', 'id', 'goods_id');
    }
}